package com.team.order.domain.enums;

/**
 * 支付方式枚举
 * @author 梁国瑞
 */
public enum PayTypeEnum {
    WECHAT(0, "微信支付"),
    ALIPAY(1, "支付宝"),
    BANK_CARD(2, "银行卡");
    
    private final Integer code;
    private final String label;
    
    PayTypeEnum(Integer code, String label) {
        this.code = code;
        this.label = label;
    }
    
    public Integer getCode() {
        return code;
    }
    
    public String getLabel() {
        return label;
    }
    
    public static PayTypeEnum getByCode(Integer code) {
        for (PayTypeEnum payType : values()) {
            if (payType.getCode().equals(code)) {
                return payType;
            }
        }
        return null;
    }
} 